using CommandLine;
using CommandLine.Text;

namespace ChainMath.Generator
{
    internal class ChainMathGeneratorOptions : CommandLineOptionsBase
    {
        public enum CMTargetLanguage
        {
            NotSpecified = 0,
            Cs = 1,
            Vb = 2,
            JScript = 3
        }

        [Option("N", "namespace", HelpText = "Namespace in output file")]
        public string Namespace { get; set; }

        [Option("G", "global-namespace", HelpText = "Use global namespace")]
        public bool GlobalNamespace { get; set; }

        [Option("o", "output-file", HelpText = "Output file (will be printed to STDOUT if not specified)")]
        public string OutputFile { get; set; }

        private CMTargetLanguage _targetLanguage;

        [Option("t", "target-language", HelpText = "Target language Cs|Vb|JScript (Cs is default)")]
        public CMTargetLanguage TargetLanguage
        {
            get { return _targetLanguage == CMTargetLanguage.NotSpecified ? CMTargetLanguage.Cs : _targetLanguage; }
            set { _targetLanguage = value; }
        }

        [HelpOption("?", "help", HelpText = "Display helpcom")]
        public string GetUsage()
        {
            return HelpText.AutoBuild(this, current => HelpText.DefaultParsingErrorsHandler(this, current));
        }
    }
}